Release 10.1A: OpenEdge Data Management:
SQL Reference
CURRVAL
CURRVALreturns the current value of a sequence, and uses the following syntax to reference the current value of a sequence.
schemaSpecifies the schema that contains the sequence. To refer to the current value of a sequence in the schema of another user, you must have
SELECTobject privilege on the sequence.sequenceSpecifies the name of the sequence whose current value you want.
Use
CURRVALin the:
CURRVALcannot be used in:Example
- A query of a view.
- A
SELECTstatement with aGROUP BYclause that references a sequence.- A
SELECTstatement with anORDER BYclause that references a sequence.- A
SELECTstatement that is combined with anotherSELECTstatement with theUNION,INTERSECT, orMINUSset operator.- The
WHEREclause of aSELECTorUPDATEstatement.- The
DEFAULTvalue of a column in aCREATE TABLEorALTER TABLEstatement.- The condition of a
CHECKconstraint.In the following example, the OpenEdge SQL sequence generator returns the current value of the customer sequence:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |